import request from '@/utils/request'
import { praseStrEmpty } from '../../utils/ruoyi'

// 查询频道列表
export function listChannel(query) {
  return request({
    url: '/system/channel/list',
    method: 'get',
    params: query
  })

}
// 查询频道详细
export function getChannel(channelId) {
  return request({
    url: '/system/channel/' + praseStrEmpty(channelId),
    method: 'get',
  })

}
// 新增频道
export function addChannel(data) {
  return request({
    url: '/system/channel/',
    method: 'post',
    data:data
  })

}

// 修改频道
export function updateChannel(data) {
  return request({
    url: '/system/channel/',
    method: 'put',
    data:data
  })

}

// 删除频道
export function delChannel(channelId) {
  return request({
    url: '/system/channel/' +channelId,
    method: 'delete',
  })

}
// 获取父频道
export function getParentChannel() {
  return request({
    url: '/system/channel/getParentChannel' ,
    method: 'get',
  })

}
